#!/usr/bin/env bash

set -ex

curr_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo $curr_dir

# remove old
[ -f yurt-app-manager ] && rm yurt-app-manager

# compile
cd ../../../
rm -Rf _output
GOOS=linux make build WHAT=cmd/yurt-app-manager

# come back to working dir
cd $curr_dir
cp /Users/c.zheng/Work/openyurt/_output/bin/linux/amd64/yurt-app-manager yurt-app-manager
docker build . -t openyurt/yurtappmanager:app
docker push openyurt/yurtappmanager:app
